namespace Asmex.FileViewer
{
    using Asmex.ObjViewer;
    using System;
    using System.IO;

    public class DataDir : Region
    {
        private string _Name;
        private uint _Rva;
        private uint _Size;

        public DataDir(BinaryReader reader, string name)
        {
            base.Start = reader.BaseStream.Position;
            base.Length = 8L;
            this._Name = name;
            this._Rva = reader.ReadUInt32();
            this._Size = reader.ReadUInt32();
        }

        public override string ToString()
        {
            string[] strArray = new string[] { base.ToString(), " ", this.Name, " points to {", this.Rva.ToString("X8"), " - ", (this.Rva + this.Size).ToString("X8"), "}" };
            return string.Concat(strArray);
        }

        public string Name
        {
            get
            {
                return this._Name;
            }
        }

        [ObjViewer(Hex=true)]
        public uint Rva
        {
            get
            {
                return this._Rva;
            }
        }

        [ObjViewer(Hex=true)]
        public uint Size
        {
            get
            {
                return this._Size;
            }
        }
    }
}
